﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;




namespace devtm.Types
{

    public class EnumeratorGac : IEnumerator<AssemblyDescription>
    {

        AssemblyCacheEnum e;

        public EnumeratorGac()
        {

        }


        public AssemblyDescription Current { get { return _current; } }
        object global::System.Collections.IEnumerator.Current { get { return _current; } }


        public void Dispose()
        {
            e = null;
        }

        

        public bool MoveNext()
        {
            if (e == null)
                e = new AssemblyCacheEnum(null);

            string name = e.GetNextAssembly();
            
            if (string.IsNullOrEmpty(name))
                return false;

            _current = new AssemblyDescription(name);

            return true;
        }

        public void Reset()
        {
            e = null;
        }


        private AssemblyDescription _current;

    }

}
